@extends('home.layout.index')
@section('con')
<script type="text/javascript" src="/homeCSS/js/jquery-1.8.3.min.js"></script>
<div role="main" class="zg-wrap zu-main clearfix ">
  <div class="zu-main-content">
    <div class="zu-main-content-inner">
      <div class="zm-topic-cat-page">
        <div class="zm-topic-cat-title">
          <a class="zg-link-gray zg-right" href="/people/shi-hao-gogo/topics">
            <span>
              已关注0个人
            </span>
          </a>
          <h2>
            <i class="zg-icon zg-icon-topic-square">
            </i>
            先关注几个人吧
          </h2>
        </div>
        <div class="zm-topic-cat-sub">
          <div data-init="{&quot;params&quot;: {&quot;topic_id&quot;: 253, &quot;offset&quot;: 0, &quot;hash_id&quot;: &quot;1736f0b08b3128a9c17a0dade5060578&quot;}, &quot;nodename&quot;: &quot;TopicsPlazzaListV2&quot;}"
          class="zh-general-list clearfix" style="display: block;">
            @foreach($res2 as $k=>$v)
            <div class="item">
              <div class="blk">
                <a href="/topic/19550994" target="_blank">
                  <img alt="游戏" src="{{$v->pic}}">
                  <strong>
                    {{$v->nickName}}
                  </strong>
                </a>
                <p>
                  {{$v->introduce}}
                </p>
                <a class="follow meta-item zg-follow"  href="javascript:;" id="t::-253">
                  <i class="z-icon-follow">
                  </i>
                  <?php $uid=$_SESSION['id'] ?>
                  @if(($v->uid)==$uid)
                  <span class="guanzhu" uid="{{$v->uid}}">自己不能关注自己</span>
                  @endif
                  @if(($v->uid)!==$uid)
                  <span class="guanzhu" uid="{{$v->uid}}">关注</span>
                  @endif
                 
                </a>
              </div>
            </div>
            @endforeach
           <script>
           $('.guanzhu').click(function(){
            var uid=$(this).attr('uid');
            var dd=$(this);
            //发送ajax
             $.ajax({
                      url:'/home/user/gzuser',
                      data:{uid:uid},
                      type:'get',
                      success:function(data){
                       if (data) {
                        var create='<span class="guanzhu" uid="{{$v->uid}}">取消关注</span>';
                        dd.parent().append(create);
                        dd.remove();

                       };
                       }
             })
           })
           </script>
          </div>
          <a aria-role="button" class="zg-btn-white zu-button-more">
            更多
          </a>
          <a style="display:none" class="zg-btn-white zg-r3px zu-button-more" data-method="next"
          id="zh-load-more" href="javascript:;">
            更多
          </a>
        </div>
      </div>
    </div>
  </div>
</div>

@endsection